import { request } from "@/utils/service"
import type * as Acc from "./types/acc"
import { http } from "@/utils/service"
/** 获取opc数据 */
export function getValuesApi() {
  return request({
    url: "/api/Values",
    method: "get"
  })
}

/** 获取范围配置数据 */
export function getInitApi() {
  return request({
    url: "/api/init",
    method: "get"
  })
}
export function saveConfigApi(data: Acc.RequestData) {
  return request<Acc.RequestData>({
    url: "/api/saveconfig",
    method: "post",
    data
  })
}

export function saveSysLoglistApi(data: Array<Acc.SysLog>) {
  return request<Acc.RequestData>({
    url: "/api/writelogs",
    method: "post",
    data
  })
}
export function saveSysLogApi(data: Acc.SysLog) {
  return request({
    url: "/api/writelog",
    method: "post",
    data
  })
}

export async function getSysLogApi(data: any) {
  const result = await request({
    url: "/api/logs",
    method: "get",
    data
  })
  return result
}

export function writeOpcListApi(data: any) {
  return request({
    url: "/api/writeopclist",
    method: "post",
    data
  })
}

export function getAccApi(data:any){
  return request({
    url:"/ai/accs",
    method:"post",
    data
  })
}

// export function getAccApi(data: any) {
//   return http({ url: import.meta.env.VITE_ACC_PRED_API+"accs", method: "post", data })
// }
